package com.ant.storage.pojo;

import com.ant.storage.vo.CommodityVo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author melon
 * @since 2022-03-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("goods_pool")
@ApiModel(value="GoodsPool对象", description="")
@JsonInclude(value= JsonInclude.Include.NON_NULL)
public class GoodsPool implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("city_id")
    private Integer cityId;

    @ApiModelProperty(value = "申请部门")
    @TableField("department_id")
    private Integer departmentId;

    @ApiModelProperty(value = "采购清单编号")
    @TableField("subscribe_number")
    private String subscribeNumber;

    @ApiModelProperty(value = "申请人")
    @TableField("proposer_id")
    private Integer proposerId;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "审批id")
    @TableField("process_instance_id")
    private String processInstanceId;

    @ApiModelProperty(value = "钉钉审核状态 1 审核中 2 审核通过 3 审核拒绝")
    @TableField("apply_status")
    private Integer applyStatus;

    @ApiModelProperty(value = "申请类型")
    @TableField("apply_type")
    private Integer applyType;

    @ApiModelProperty(value = "采购人id")
    @TableField("purchaser_id")
    private Integer purchaserId;

    @ApiModelProperty(value = "申请金额")
    private BigDecimal price;

    @ApiModelProperty(value = "是否分单 0 未分单  1 已分单")
    private Integer splitting;

    @ApiModelProperty(value = "审核状态 0 未处理  1 取消  2 生成采购单 3 采购中 4 完成采购   5 已签收")
    private Integer status;

    @ApiModelProperty(value = "要货时间")
    @TableField("delivery_time")
    private Date deliveryTime;

    @TableField("creator_by")
    private String creatorBy;

    @ApiModelProperty(value = "创建时间")
    @TableField("creation_time")
    private Date creationTime;

    @ApiModelProperty(value = "创建时间")
    @TableField("is_delete")
    private Integer isDelete;

    @NotNull (message = "物品不能为空")
    @Size(min = 1, message = "至少要有一个物品")
    @ApiModelProperty(value = "申请物品列表")
    @TableField(exist = false)
    private  List<CommodityVo> commodityList;

    @ApiModelProperty(value = "钉钉申请人Id")
    @TableField(exist = false)
    @JsonInclude(value= JsonInclude.Include.NON_NULL)
    private String userId;

    @ApiModelProperty(value = "钉钉申请部门Id")
    @TableField(exist = false)
    private Integer deptId;

    @ApiModelProperty(value = "钉钉申请城市")
    @TableField(exist = false)
    private String city;

    @ApiModelProperty(value = "钉钉申请部门")
    @TableField(exist = false)
    private String department;

    @ApiModelProperty(value = "审核人")
    @TableField(exist = false)
    private List<String> approval;

    @ApiModelProperty(value = "抄送人")
    @TableField(exist = false)
    private List<String> notify;

    @ApiModelProperty(value = "审核记录")
    @TableField(exist = false)
    private List<AuditList> auditList;


    @ApiModelProperty(value = "审核记录")
    @TableField(exist = false)
    private ApprovalMsg approvalMsgList;


    @ApiModelProperty(value = "是否审批 0 否 1 是")
    @TableField(exist = false)
    private Integer isApproved;

}
